import 'package:blog/app/package_info.dart';
import 'package:blog/base/get/getx_controller_inject.dart';
import 'package:blog/model/lightcloud/website_info.dart';
import 'package:blog/ui/dialog/dialog_share_appliction.dart';
import 'package:blog/util/constant.dart';
import 'package:blog/util/save/sp_util.dart';
import 'package:blog/util/toast_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';



/// @class : SplashController
/// @date : 2021/08/15
/// @name : CTGU_LLZ(404name)
/// @description :启动页 控制器层
class SplashController extends BaseGetController {

  ///用来控制动画的状态
  double opacityLevel = 0.0;
  late WebsiteInfo websiteInfo;

  @override
  void onInit() {
    super.onInit();
    getWebsiteInfo();
    lazyInitAnim();
  }


  getWebsiteInfo(){
    request.websiteInfo(success: (data,over) {
      ///添加自定义的积分排行榜图片
      websiteInfo = data;
      print(websiteInfo.websiteConfig.version);
      SpUtil.putWebsiteInfo(websiteInfo);
      print("拉取网站信息");
    });
  }
  lazyInitAnim(){
    Future.delayed(const Duration(milliseconds: 200), () {
       opacityLevel = 1.0;
       update();
    });

  }


}
